package org.simple.learning.sock;

import org.simple.learning.sock.domain.WiselyMessage;
import org.simple.learning.sock.domain.WiselyResponse;
import org.springframework.messaging.handler.annotation.MessageMapping;
import org.springframework.messaging.handler.annotation.SendTo;
import org.springframework.stereotype.Controller;

/**
 * 项目名称：spring-boot-learning
 * 类名称：WsController
 * 类描述：WsController
 * 创建时间：2019/7/31
 *
 * @author guihuo   (E-mail:1620657419@qq.com)
 * @version v1.0
 */
@Controller
public class WsController {

    @MessageMapping("/welcome")
    @SendTo("/notify/getResponse")
    public WiselyResponse say(WiselyMessage message) throws Exception {
        return new WiselyResponse("Welcome, " + message.getName() + "!");
    }

}
